<?php
class helper_form_checkbox extends system_view_helper_formElement {
	
	public function checkbox($name, $value, $attribs = null) {
		$info = $this->_getInfo($name, $value, $attribs);
		$label = '';
		$id = $info['id'];
		$value = $info['value'];
		if(isset($info['attribs']['label'])) {
			$label = '<label for="' . $id . '">' . $this->getView()->escape($info['attribs']['label']) . '</label>';
			unset($info['attribs']['label']);
		}	
		$xhtml = '';
		$attr = $this->_htmlAttribs($info['attribs']);
		$xhtml .= '<input type="checkbox" name="' . $info['name'] . '" id="' . $id . '" ';
		$xhtml .= 'value="' . $value . '" ' . $attr . $this->getClosingBracket() . $label;
		return $xhtml;
	}
	
	
}